#include "CEC2017_F2.h"

namespace Solver
{

CEC2017_F2::CEC2017_F2(std::size_t dim):BaseTestFun(dim, FunType_E::CEC2017_F2_E, DifficultyLevel_E::Easy_E, "CEC2017_F2", "")
{
    passY_ = 1e-12;
    bestY_ = 0;
}

CEC2017_F2::~CEC2017_F2()
{

}

value_t CEC2017_F2::calcMinFun(const VectorXd_t &x)
{
    value_t sum(0);
    const std::size_t num = x.size();
    for (std::size_t i = 0; i != num; ++i)
    {
        sum += std::pow(std::fabs(x[i]), i + 2);
    }

    return sum;
}

}